package com.android.avy;

import java.util.HashMap;

import android.content.ContentResolver;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.provider.BaseColumns;
import android.text.format.Time;

public interface ZoneData {
	public Drawable getRose();
	
	public String getName();
	
	public int getDanger();
	
	public String getAdvisory();
	
	static public final String AUTHORITY = "com.android.avy.provider";
	
	static public final class ZoneDays implements BaseColumns {
		
		private ZoneDays() {}
		
		static public final String TABLE_NAME = "zonedays";
		
		static public final String COL_NAME_DATE = "date";
		
		static public final String COL_NAME_ZONE = "zone_name";
		
		static public final String COL_NAME_STATE = "state";
		
		static public final String COL_NAME_ROSE = "colors";
		
		static public final String COL_NAME_TEMPS = "temps";
		
		static public final String COL_NAME_SNOWFALL = "snowfall";
		
		static public final String COL_NAME_STATEMENT = "statement";
		
		static public final HashMap<String, String> COL_TYPES;
		
		static {
			COL_TYPES = new HashMap<String, String>();
			COL_TYPES.put(COL_NAME_DATE, "string");
			COL_TYPES.put(COL_NAME_ZONE, "string");
			COL_TYPES.put(COL_NAME_STATE, "string");
			COL_TYPES.put(COL_NAME_ROSE, "string");
			COL_TYPES.put(COL_NAME_TEMPS, "string");
			COL_TYPES.put(COL_NAME_SNOWFALL, "string");
			COL_TYPES.put(COL_NAME_STATEMENT, "string");

		}
		
		static public final class ZoneDate {
			public String date;
			public String zone;
			
			public ZoneDate() {}
			
			public ZoneDate(String z) {
				Time t = new Time();
				t.setToNow();
				date = t.toString().substring(0, 8);
				zone = z;
			}
		}
		
		static public final String SCHEME = "content://";
		
		/** In the 'path' part of the Uri, the level where the user puts the zoneday _id.
		 * For example, the user requests _id = 3 of the table via the Uri:
		 * content://com.android.avy.avyprovider/zonedays/3
		 */
		static public final int ZONEDAY_ID_PATH_POSITION = 1;
		
		static public final String CONTENT_TYPE = "vnd.android.cursor.dir/vnd.avy.zonedays";
		
		static public final String CONTENT_TYPE_ITEM = "vnd.android.cursor.item/vnd.avy.zonedays";

		static public final Uri CONTENT_URI = Uri.parse(SCHEME + AUTHORITY + "/" + TABLE_NAME);
		
		static public final Uri CONTENT_URI_BASE = Uri.parse(SCHEME + AUTHORITY + "/" + TABLE_NAME + "/");

		/**
         * Column name for the modification timestamp
         * <P>Type: INTEGER (long from System.curentTimeMillis())</P>
         */
        public static final String COL_NAME_MODIFICATION_DATE = "modified";
	}
}
